/* 
    2020 07 27
    lili
    关注“有来”公众号
*/
var wechatHtml = '<div id="followWechat" style="display: none;">';
    wechatHtml += '<div class="mask-black"></div>';
    wechatHtml += '<div class="follow-popup list-flex-in"><div><div class="fol-con">';
    wechatHtml += '<h3>关注“有来”公众号</h3>';
    wechatHtml += '<p id="popTips">微信搜索并关注“有来”。<br>或长按下载二维码进行关注</p>';
    wechatHtml += '<div class="ylQRcode"><img src="images/youlai/patient/logo/ylcode.png"></div>';
    wechatHtml += '</div>';
    wechatHtml += '<div class="close-pop list-flex-in"><div id="popClose" class="icon-close"></div></div>';
    wechatHtml += '</div></div></div>';
$('body').append(wechatHtml);
$('.go-wechat').click(function(){$('#followWechat').show(); downloadApp();})
$('#popClose').click(function(){$('#followWechat').hide(); })
downloadApp();
function downloadApp(){
    var u = navigator.userAgent;
    var ua = navigator.userAgent.toLowerCase();
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    if(ua.match(/MicroMessenger/i)=="micromessenger") { //微信内置浏览器
        // alert("微信内置浏览器")
        $('#popTips').html('微信搜索并关注“有来”。<br>或长按下方二维码识别并关注');
    }else{
        if(isiOS){
            // alert("ios终端")
        }else if(isAndroid){
            // alert("android终端")
        }else{
            // alert("pc")
        }
    }
}